<template>
	<div>
		<el-container style="height: 900px; border: 1px solid #eee">
		  <el-container class="cont">
		    <el-header style="text-align: right; font-size: 20px">
		      <el-dropdown>
		        <i class="el-icon-setting" style="margin-right: 5px"></i>
		        <el-dropdown-menu slot="dropdown">
		          <el-dropdown-item>注销</el-dropdown-item>
		        </el-dropdown-menu>
		      </el-dropdown>
		      <span>{{userid}}</span>
		    </el-header>
		    
		    <el-main class="Emain">
          <Back></Back>
				<div align="center" style="margin-top: 100px;">
					<font size="5" face="comic sans ms">电子账户明细</font>
					<el-button @click="addElEmail" style="float: right;" type="primary" plain icon="el-icon-circle-plus-outline">添加</el-button>
				</div>
				  <el-table 
				  :data="tableData" 
				  stripe 
				  height="350"
				  @row-click="handle"
				  class="Etab">
					<el-table-column prop="a_type" label="账户类型" width="170">
					</el-table-column>
					<el-table-column prop="money" label="账户余额" width="200">
					</el-table-column>
					<el-table-column prop="id" label="账号id" width="200">
					</el-table-column>
				  </el-table>
		    </el-main>
		  </el-container>
		</el-container>
	</div>
</template>

<script>
import back from '@/components/back/Return';
export default {
  data() {
	  const item = {
	          a_type: '2016-05-02',
	          money: '王小虎',
	          id: '上海市普陀区金沙江路 1518 弄'
	        };
    return {
		userid:'',
		tableData: Array(20).fill(item),
    }
  },
  methods: {
	  handle(row, event, column) {
		  window.localStorage.setItem("id",JSON.stringify(row.id));
		  this.$router.push('/System');
	  },
	  addElEmail() {
		  this.$router.push('/AddElEmail');
	  },
  },
  mounted(){
  	var that=this;
  	var usersid=JSON.parse(window.localStorage.getItem("userid"));
	that.userid=usersid;
	//我这里能拿到返回来的电子账户
	// this.$axios.post('http://localhost:8086/dormitorydisinfectioncount/queryDormitoryDisinfection',{
	// 		enterpriseid:users.enterpriseid
	// }).then(function (res) {
	// 		//console.log(res.data);
	// 		for(let i=0;i<10;i++){
	// 			if(res.data[i]==null){
	// 					 break;
	// 			}
	// 			that.tableData2[i]=res.data[i];
	// 		}
	// 		that.tableData=that.tableData2;
	// 		that.tableData1=res.data;
	// 		that.title=res.data.length;
	// 		that.json_data=res.data;
	// 	}).catch(function(err) {
	// 			console.log(err);
	// 	});
  },
  components: {
    'Back': back
  }
}
</script>

<style>
  .el-header {
    background-color: #aaaaff;
    color: #333;
    line-height: 60px;
  }
  
  .el-aside {
    color: #333;
  }
  .Etab{
	width: 580px;  
  }
 .Emain{
	margin: auto;
  }
  .cont{
	  background-image: url(../../img/sky.jpg);
  }
</style>
